﻿using Org.LyrcsoftFramework.Cloud.Feign;
using Org.LyrcsoftFramework.Cloud.OpenFeign.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace MyFeignTest.Feign.Service
{
    //[FeignClient(Url = "http://127.0.0.1:5000", IsIgnoreHttpsCertificateValidate = true, Timeout = 100)]
    [FeignClient(ServiceName = "WebApiTest", MicroServiceMode = true, IsIgnoreHttpsCertificateValidate = true, Timeout = 100)]
    public interface ITestFeignSerivce
    {
        [GetMapping("/api/echo")]
        Task<IEnumerable<String>> Get();
    }

    //public class ITestFeignSerivceProxy : ITestFeignSerivce
    //{
    //    public HttpService httpService;
    //
    //    public ITestFeignSerivceProxy(HttpService httpService)
    //    {
    //        this.httpService = httpService;
    //    }
    //
    //    public Task<IEnumerable<String>> Get()
    //    {
    //        List<Object> originArgs = new List<Object>();
    //        MethodInfo method = this.GetType().GetMethods()[0];
    //        return httpService.ExecuteAsync<IEnumerable<String>>(originArgs, method);
    //    }
    //}
}
